<?php
/*------------------------------
运行时间计算
------------------------------*/

class runtimer{
	var $StartTime = 0;
	
	function runtimer(){
		$this->StartTime = $this->microtime_float();
	}
	
	function time(){
		$ThisTime = $this->microtime_float();
		$rt = $ThisTime - $this->StartTime;
		if( $rt< 0.0001)$rt = "< 0.0001";
		else $rt = substr($ThisTime - $this->StartTime,0,7);
		return $rt;
	}
	
	function microtime_float(){
	    list($usec, $sec) = explode(" ", microtime());
	    return ((float)$usec + (float)$sec);
	}

}